﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MPMusicVids.Data;
using System.Threading;

namespace MPMusicVids
{
    public partial class mainConfig : Form
    {
        MainPanel mp = new MainPanel();
        Parsing lp = new Parsing();
        Settings sp = new Settings();
        DVDPanel dp = new DVDPanel();
        public mainConfig()
        {
            InitializeComponent();
        }

        private void mainConfig_Load(object sender, EventArgs e)
        {
            mainTab.TabPages[0].Controls.Add(mp);
            mainTab.TabPages[1].Controls.Add(dp);
            mainTab.TabPages[2].Controls.Add(sp);
            mainTab.TabPages[3].Controls.Add(lp);
            mp.reLoad();
        }

        private void mainTab_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (mainTab.SelectedIndex == 3)
            {
                new Thread(new ThreadStart(lp.doParseTest)).Start();
            }
            if (mainTab.SelectedIndex == 2)
            {
                sp.LoadSettings();
            }
            if (mainTab.SelectedIndex == 1)
            {
                mainTab.SelectedIndex = 2;
            }
            if (mainTab.SelectedIndex == 0)
            {
                mp.reLoad();
            }
        }
    }
}
